package java基础.array;

/**
 * @author IT_Jay
 * @date 2022/1/17 18:20
 */

public class arrayDemo05 {
    public static void main(String[] args) {
        //[3][2]
        int[][] array = {{10,2},{20,3},{30,4}};
        printArray(array[0]);
        System.out.println("\n"+array[0][0]);
        System.out.println(array.length);
        System.out.println(array[0].length);
        System.out.println("=========================================");
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.println(array[i][j]);
            }
        }
    }

    //定义打印数组元素的方法
    public static void printArray(int[] arrays) {
        for (int i = 0; i < arrays.length; i++) {
            System.out.print(arrays[i] + "\t");
        }
    }
}
